import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: Text('demo'),
          ),
          body: const HomeContent(),
        ),
        theme: ThemeData(primarySwatch: Colors.yellow));
  }
}

class HomeContent extends StatelessWidget {
  const HomeContent({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      // height: 180,
      child: ListView(
        scrollDirection: Axis.horizontal,
        padding: const EdgeInsets.all(20),
        children: <Widget>[
          const jiange(),
          const jiange(),
          const jiange(),
          const jiange(),
        ],
      ),
    );
  }
}

class jiange extends StatelessWidget {
  const jiange({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 180,
      color: Colors.red[50],
      margin: EdgeInsets.fromLTRB(0, 0, 30, 0),
    );
  }
}
